<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="vue" v-clock>
			<div>{{info.name}}</div>
			<div>{{info.address.street}}</div>
			<a v-bind:href="info.url">神秘链接</a>
		</div>
		
		<!--导入JS文件-->
		<script src='https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js'></script>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
		<script type="text/javascript">
		var vm = new Vue({
				el: "#vue",
				
				data(){		
					return{//请求返回的参数和json字符串一致
						info:{
							name: null,
							address: {
								street: null,
									city: null,
									country: null
							},
							url: null
						}
					}
				},
				mounted(){//钩子函数，链式
					axios.get('data.json').then(response=>(this.info=response.data));
				}
				
			});
		</script>
	</body>
</html>
